common/vsprintf: Explicitly treat negative lengths as 'unlimited'
authorTim Deegan <tim@xen.org>
Thu, 28 Nov 2013 14:33:06 +0000 (14:33 +0000)
committerTim Deegan <tim@xen.org>
Thu, 6 Mar 2014 10:12:38 +0000 (10:12 +0000)
commit034a5199c620596c9fc95a8cb7de122a922dc428
treeedcda8a99d144248a193508ffcc30b62268e90d1
parentceff76a5be3caaca028ea8a6cbce5744eaf2b2db
common/vsprintf: Explicitly treat negative lengths as 'unlimited'

The old code relied on implictly casting negative numbers to size_t
making a very large limit, which was correct but non-obvious.

Coverity CID 1128575

Signed-off-by: Tim Deegan <tim@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/common/vsprintf.c